package com.woniuxy.ticketuser.ticketuser.controller;

import com.woniuxy.ticket.commons.entity.ResponseResult;
import com.woniuxy.ticketuser.ticketuser.service.UserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

    //下订单后增加用户积分
    @PostMapping("/updateIntegration")
    public ResponseResult updateIntegration(@Min(value = 1,message = "排片-座位中间表id至少为1") @NotNull(message = "排片-座位中间表id不能为空") int id){
        userService.updateIntegration(id);
        return new ResponseResult().success();
    }
}
